package com.basic;

import com.frame.struts.BaseBean;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;
import com.utils.*;
import java.util.Date;


/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class MainProductStrutForm extends BaseBean {
    public MainProductStrutForm() {
    }
	private String oldId = "";
	


	
	MainProductStrutEntity msre = new MainProductStrutEntity();
	public String addMainProductStrut(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		//String qyid = (String) request.getSession().getAttribute("session_qyid");
		msre.setOptdate(new Date());
		msre.setOptrid(CommUtil.getUserId(request));
		this.setXh(BasicFactory.getMaxVal("qy_ycl", "xh"));
		try{
		if(factory.addMainProductStrut(msre)){
			    response.sendRedirect(request.getContextPath()+"kehuzk/queryMainProductStrut.jsp?cpid="+msre.getCpid());
		}else{
		response.sendRedirect(request.getContextPath()+"/failed.jsp");
		}
		}
		catch (Exception e) {

		}

			return null;
	}
	public String modifyMainProductStrut(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		msre.setOptdate(new Date());
		msre.setOptrid(CommUtil.getUserId(request));
		factory.deleteMainProductStrut(msre.getXh());
		msre.setXh(BasicFactory.getMaxVal("qy_ycl", "xh"));
		try{
			if(factory.addMainProductStrut(msre)){
				    response.sendRedirect(request.getContextPath()+"kehuzk/queryMainProductStrut.jsp?cpid="+msre.getCpid());
			}else{
			response.sendRedirect(request.getContextPath()+"/failed.jsp");
			}
			}
			catch (Exception e) {

			}

				return null;
	}
	public String getOldId(){
		return this.oldId;
	}
	public void setOldId(String oldId){
		this.oldId=oldId;
	}
	public String getScqkmsx() {
		return msre.getScqkmsx();
	}
	/**
	 * @param fkfs The fkfs to set.
	 */
	public void setScqkmsx(String scqkmsx) {
		msre.setScqkmsx(scqkmsx);
	}

	public String getDycp() {
		return msre.getDycp();
	}
	public void setDycp(String dycp) {
		msre.setDycp(dycp);
	}
	public String getPjdj() {
		return msre.getPjdj();
	}
	public void setPjdj(String pjdj) {
		msre.setPjdj(pjdj);
	}
	public String getGrsj() {
		return msre.getGrsj();
	}
	public void setGrsj(String grsj) {
		msre.setGrsj(grsj);
	}
	public String getBz() {
		return msre.getBz();
	}
	public void setBz(String bz) {
		msre.setBz(bz);
	}
	public int getXh() {
		return msre.getXh();
	}
	public void setXh(int xh) {
		msre.setXh(xh);
	}

	/**
	 * @return msre.getReturns the cbbz.
	 */
	public double getCbbz() {
		return msre.getCbbz();
	}
	/**
	 * @param cbbz The cbbz to set.
	 */
	public void setCbbz(double cbbz) {
		msre.setCbbz(cbbz);
	}
	/**
	 * @return msre.getReturns the cpid.
	 */
	public int getCpid() {
		return msre.getCpid();
	}
	/**
	 * @param cpid The cpid to set.
	 */
	public void setCpid(int cpid) {
		msre.setCpid(cpid);
	}
	/**
	 * @return msre.getReturns the fkfs.
	 */
	public String getFkfs() {
		return msre.getFkfs();
	}
	/**
	 * @param fkfs The fkfs to set.
	 */
	public void setFkfs(String fkfs) {
		msre.setFkfs(fkfs);
	}
	/**
	 * @return msre.getReturns the optdate.
	 */
	public Date getOptdate() {
		return msre.getOptdate();
	}
	/**
	 * @param optdate The optdate to set.
	 */
	public void setOptdate(Date optdate) {
		msre.setOptdate(optdate);
	}
	/**
	 * @return msre.getReturns the optrid.
	 */
	public String getOptrid() {
		return msre.getOptrid();
	}
	/**
	 * @param optrid The optrid to set.
	 */
	public void setOptrid(String optrid) {
		msre.setOptrid(optrid);
	}
	/**
	 * @return msre.getReturns the recstate.
	 */
	public String getRecstate() {
		return msre.getRecstate();
	}
	/**
	 * @param recstate The recstate to set.
	 */
	public void setRecstate(String recstate) {
		msre.setRecstate(recstate);
	}
	/**
	 * @return msre.getReturns the remark.
	 */
	public String getRemark() {
		return msre.getRemark();
	}
	/**
	 * @param remark The remark to set.
	 */
	public void setRemark(String remark) {
		msre.setRemark(remark);
	}
	/**
	 * @return msre.getReturns the zyycl.
	 */
	public String getZyycl() {
		return msre.getZyycl();
	}
	/**
	 * @param zyycl The zyycl to set.
	 */
	public void setZyycl(String zyycl) {
		msre.setZyycl(zyycl);
	}

}